﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using University.Workshop.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace University.Workshop.Tests.PatientFolder
{
    [TestClass]
    public class PatientTest
    {
        [TestMethod]
        public void RegisterPatientTest()
        {
            MockupRegisterPatient view = new MockupRegisterPatient();
            Presenters.PatientFolder.PresenterPatient presenter = new Presenters.PatientFolder.PresenterPatient(view);

            view.PatientId = "123456";
            view.FirstName = "juancito";
            view.FatherLastName = "Pinto";
            view.MotherLastName = "Orgas";
            view.LandPhone = "1234456";
            view.CellPhone = "12345678";
            view.Address = "calle oruro";

            string message = presenter.AddPatient();
            Assert.AreEqual("El paciente se registro con exito", message);

            //Borrar de la base de datos
            

        }

        [TestMethod]
        public void SearchPatientTest()
        {
            MockupSearchPatient view = new MockupSearchPatient();
            Presenters.PatientFolder.PresenterSearchPatient presenter = new Presenters.PatientFolder.PresenterSearchPatient(view);
            view.FatherLastName = "Pinto";

            List<Patient> patients = (List<Patient>)presenter.SearchPatient();
            Assert.AreNotEqual(null, patients);
        }

        [TestMethod]
        public void ShowPatientTest()
        {
            MockupShowPatient view = new MockupShowPatient();
            Presenters.PatientFolder.PresenterPatientHistory presenter = new Presenters.PatientFolder.PresenterPatientHistory(view);
            view.PatientId = "123456";

            Patient patient = presenter.ShowPatient();
            Assert.AreNotEqual(null, patient);
        }
    }
}
